package com.hps.demo.controller;

import com.hps.demo.msg.OrderTopicProducer;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author heps
 * @since 2020/7/23 10:14
 */
@AllArgsConstructor
@RestController
@RequestMapping("/msg")
public class MsgController {

  private OrderTopicProducer orderTopicProducer;

  @GetMapping("/{content}")
  public Boolean send(@PathVariable("content") String content) {
    orderTopicProducer.send(content);
    return true;
  }
}
